home *** CD-ROM | disk | FTP | other *** search
/ Micromanía 85 / CDMM85_1.ISO / Monopoly Tycoon / MTycoonDemo.exe / data1.cab / scripts / TUTORIAL8 / hub.lua next >
Encoding:
Text File  |  2001-10-24  |  6.6 KB  |  181 lines

  1. PromptHeading = ID_TUTORIAL_8_OFFSET + 1
  2. g_currentprompt = 0;
  3. g_counter = 0;
  4. Tweaks.numyearsin24hours = 0;
  5.  
  6. -------------------------------------------------------------------------------------------------
  7. -- INITIALISE_Level. Standard level event
  8. -------------------------------------------------------------------------------------------------
  9. function EVENTINITIALISE_Level()
  10.     -- load the building and business file
  11.     C_RunScript("scripts\\maps\\shoppingmap.lua");
  12.     C_RunScript("scripts\\tutorial8\\initialpref.lua");
  13. end;
  14.  
  15. -------------------------------------------------------------------------------------------------
  16. -- Level. Standard level event.
  17. -------------------------------------------------------------------------------------------------
  18. function EVENT_Level()
  19.     -- create an initial prompt
  20.     C_TriggerEvent("BlockCam", 1, KENTUCKY_AVENUE);
  21.  
  22.     Interface.DisableAllControls();
  23.     Interface.DisableAll3DPicking();
  24. --    Interface.DisableCameraControl();
  25.  
  26.     -- create the initial prompt
  27.     CreatePrompt(1);
  28. end;
  29.  
  30. function CATCHEVENT_InterfacePromptDismiss(a)
  31.  
  32.     if g_currentprompt == 9 then
  33.         return 0;
  34.     end;
  35.  
  36.     if g_currentprompt == 8 then
  37.         return 0;
  38.     end;
  39.  
  40.     if g_currentprompt == 7 then
  41.         Game.Unpause();
  42.     else
  43.         CreatePrompt(a);
  44.     end;
  45.  
  46. end;
  47.  
  48. function CATCHEVENT_TutorialEvent(a)
  49.  
  50.     if g_currentprompt == 12 then
  51.         Interface.DismissPrompt();
  52.     end;
  53.  
  54.     if g_currentprompt == 10 then
  55.         Interface.DismissPrompt();
  56.         Interface.DisableControl(TUT_TOGGLE_VIEW);
  57.     end;
  58.  
  59.     if a == TUT_END_BUILD and g_currentprompt == 9 then
  60.         CreatePrompt(10);
  61.     end;
  62.  
  63.     if a == TUT_MPP_GREENBUTTON_3 and g_currentprompt == 9 then
  64.         Interface.DisableControl(TUT_MPP_GREENBUTTON_3);
  65.         Interface.DismissPrompt();
  66.         Interface.EnableControlAndChildren(TUT_BUILD_PANEL);
  67.         Interface.DisableControl(TUT_BUILD_CANCEL);
  68.     end;
  69.  
  70.     if a == TUT_END_BUILD and g_currentprompt == 8 then
  71.         CreatePrompt(9);        
  72.     end;
  73.  
  74.     if a == TUT_MPP_GREENBUTTON_3 and g_currentprompt == 8 then
  75.         Interface.DisableControl(TUT_MPP_GREENBUTTON_3);
  76.         Interface.DismissPrompt();
  77.         Interface.EnableControlAndChildren(TUT_BUILD_PANEL);
  78.         Interface.DisableControl(TUT_BUILD_CANCEL);
  79.     end;
  80.  
  81.     if a == TUT_END_BUILD and g_currentprompt == 7 then
  82.         CreatePrompt(8);        
  83.     end;
  84.  
  85.  
  86.     if a == TUT_MPP_GREENBUTTON_3 and g_currentprompt == 7 then
  87.         Interface.DisableControl(TUT_MPP_GREENBUTTON_3);
  88.         Interface.DismissPrompt();
  89.         Interface.EnableControlAndChildren(TUT_BUILD_PANEL);
  90.         Interface.DisableControl(TUT_BUILD_CANCEL);
  91.     end;
  92.  
  93.     if a == TUT_BUILD_ACCEPT and g_currentprompt == 7 then
  94.         Interface.DismissPrompt();
  95.     end;
  96.  
  97.     if g_currentprompt == 3 then
  98.         Interface.DismissPrompt();
  99.         Interface.DisableControl(TUT_AERIAL_BUTTON_4);
  100.     end;
  101.  
  102.     if g_currentprompt == 2 then
  103.         Interface.DismissPrompt();
  104.         Interface.DisableControl(TUT_TOGGLE_VIEW);
  105.     end;
  106.  
  107.  
  108.  
  109. end;
  110.  
  111. function CATCHEVENT_Picked3D(a)
  112.     if a == 1 and g_currentprompt == 6 then
  113.         Interface.DismissPrompt();
  114.     end;
  115.  
  116.     if a == 0 and g_currentprompt == 4 then
  117.         Interface.DismissPrompt();
  118.         Interface.DisableAll3DPicking();
  119.     end;
  120.  
  121. end;
  122.  
  123. -- prompt manager
  124. function CreatePrompt(a)
  125.     g_currentprompt = a;
  126.     body = a+PromptHeading;
  127.     if a == 1 then
  128.         Interface.CreatePrompt(PromptHeading,body, a+1); --"There are a lot of citizens on this block who have to travel to get their shopping. I'm sure they would love to be able to shop more locally.", a+1);
  129.     elseif a == 2 then
  130.         Interface.CreateMessage(PromptHeading,body, a+1); --"First, let's go and see what the people want. Click on the Compass Button to go to Strategic View.", a+1);
  131.         Interface.EnableControl(TUT_TOGGLE_VIEW);
  132.         Interface.AddArrow(534, 461);
  133.     elseif a == 3 then
  134.         Interface.CreateMessage(PromptHeading,body, a+1); --"Click on Poll...", a+1);
  135.         Interface.PositionPrompt(0,155);
  136.         Interface.EnableControl(TUT_AERIAL_BUTTON_4);
  137.         Interface.AddArrow( 29, 146 );
  138.     elseif a == 4 then
  139.         Interface.CreateMessage(PromptHeading,body, a+1); --"In poll mode, all apartments flash. There appears to be a large apartment on Kentucky Avenue. Click on Kentucky Avenue.", a+1);
  140.         Interface.EnableBlockPicking(KENTUCKY_AVENUE);
  141.         Interface.AddArrow(366,133);
  142.     elseif a == 5 then
  143.         Interface.CreatePrompt(PromptHeading,body, a+1); --"At the top of the list are the items the most popular items. If you build stores that supply these goods you should be able to steal some of the customers away from Marvin Gardens.", a+1);
  144.         Interface.AddArrow( 180, 100 );
  145.     elseif a == 6 then
  146.         Interface.CreateMessage(PromptHeading,body, a+1); --"Let's go back to Kentucky Avenue. Double click it.", a+1);
  147.         Interface.EnableBlockPicking(KENTUCKY_AVENUE);
  148.         Interface.AddArrow(366,133);
  149.     elseif a == 7 then
  150.         Interface.CreateMessage(PromptHeading,body, a+1); --"Now let's build a store. Remember, it would be best to supply goods that the people want. People needed bread, so lets build a bakers first...", a+1);
  151.         Interface.EnableControl(TUT_MPP_GREENBUTTON_3);
  152.         Interface.SetTutorialType(0);
  153.         Interface.SetTutorialUse(1);
  154.         Interface.PositionPrompt(0,-140);
  155.     elseif a == 8 then
  156.         Interface.CreateMessage(PromptHeading,body, a+1); --"You will also have more success if you build another of the high demand stores. Drinks were high on the list, so lets build a Bar. Remember, a Bar is a night time store, so it wont open until the evening...", a+1);
  157.         Interface.EnableControl(TUT_MPP_GREENBUTTON_3);
  158.         Interface.SetTutorialType(0);
  159.         Interface.SetTutorialUse(12);
  160.     elseif a == 9 then
  161.         Interface.CreateMessage(PromptHeading,body, a+1); --"The more commodities you supply, the more customers will choose your shopping centre. The other commodity in demand was Fruit and Vegetables. Lets build a Greengrocers to cater for that...", a+1);
  162.         Interface.EnableControl(TUT_MPP_GREENBUTTON_3);
  163.         Interface.SetTutorialType(0);
  164.         Interface.SetTutorialUse(4);
  165.     elseif a == 10 then
  166.         Interface.CreateMessage(PromptHeading,body, a+1); --"There you go. Now lets have a look at how the people are responding in strategic view. If you are supplying a wider variety of popular goods closer to where the people live, they will prefer to come and shop at your businesses.", a+1);
  167.         Interface.EnableControl(TUT_TOGGLE_VIEW);
  168.         Interface.AddArrow(534, 461);
  169.     elseif a == 11 then
  170.         Interface.CreatePrompt(PromptHeading,body, a+1); --"If you wait a short while you should see more people shopping around Kentucky Avenue...", a+1);
  171.         Interface.PositionPrompt(0,150);
  172.         Interface.AddArrow(366,133);
  173.     elseif a == 12 then
  174.         Interface.CreatePrompt(PromptHeading,body, a+1); --"Feel free to build some more. Go to Options and choose Quit when you've had your fill.", a+1);
  175.     else
  176.         Game.End(true); 
  177.     end;
  178. end;
  179.  
  180.  
  181.